-
-
Notifications
You must be signed in to change notification settings - Fork 1
Io capture #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Io capture #46
Conversation
very impressive: but a radical approach: can't we somehow monkey patch the internal place/code that produces the writes? maybe this approach covers more fully/cleanly some cases, but it still seems a bit heavier on the other hand: not critical, maybe for the future, but to check the current approach: what about file/other kind of events(in the future: network and others?) wouldn't we need something different for them, or would a similar approach be possible |
I don't think that we can monkeypatch. We would need to detect all calls to C functions which deal with IO. But what if they are not from the standard library? For example our Rust module can produce logging statements which such an approach cannot handle. Here we just redirect the in, out and error streams and we capture everything that we see. It is possible to be even more ambitious on Linux using BPF. We can hook to the read and write syscalls. This means that we can map IO to which thread caused it. I am working on a prototype POC to test this approach as well. |
ok, i have to try to understand it in more detail: will try to see/or ask next week; bpf sounds interesting, maybe it can help with the general case of IO events, but still not sure if we can match them to the actual step in the general case(and here) |
5561ff3
to
f4f5981
Compare
design-docs/capture-output-implementation-plan.md: Signed-off-by: Tzanko Matev <[email protected]>
design-docs/adr/0007-io-capture.md: Signed-off-by: Tzanko Matev <[email protected]>
New design docs design-docs/adr/0008-line-aware-io-capture.md: design-docs/io-capture-line-proxy-implementation-plan.md: design-docs/prototypes/io_capture_ledger_mirror_prototype.py: Signed-off-by: Tzanko Matev <[email protected]>
codetracer-python-recorder/src/runtime/frame_inspector.rs: codetracer-python-recorder/src/runtime/line_snapshots.rs: codetracer-python-recorder/src/runtime/mod.rs: design-docs/io-capture-line-proxy-implementation-plan.status.md: Signed-off-by: Tzanko Matev <[email protected]>
8aca4fc
to
a823b35
Compare
codetracer-python-recorder/src/runtime/io_lines.rs: codetracer-python-recorder/src/runtime/mod.rs: design-docs/io-capture-line-proxy-implementation-plan.status.md: Signed-off-by: Tzanko Matev <[email protected]>
codetracer-python-recorder/src/runtime/io_lines.rs: design-docs/io-capture-line-proxy-implementation-plan.status.md: Signed-off-by: Tzanko Matev <[email protected]>
codetracer-python-recorder/src/runtime/io_capture/events.rs: codetracer-python-recorder/src/runtime/io_capture/install.rs: codetracer-python-recorder/src/runtime/io_capture/mod.rs: codetracer-python-recorder/src/runtime/io_capture/proxies.rs: codetracer-python-recorder/src/runtime/io_capture/sink.rs: codetracer-python-recorder/src/runtime/io_lines.rs: codetracer-python-recorder/src/runtime/mod.rs: design-docs/adr/0008-line-aware-io-capture.md: design-docs/io-capture-line-proxy-implementation-plan.md: design-docs/io-capture-line-proxy-implementation-plan.status.md: Signed-off-by: Tzanko Matev <[email protected]>
codetracer-python-recorder/Cargo.lock: codetracer-python-recorder/Cargo.toml: codetracer-python-recorder/src/ffi.rs: codetracer-python-recorder/src/policy.rs: codetracer-python-recorder/src/runtime/io_capture/events.rs: codetracer-python-recorder/src/runtime/io_capture/install.rs: codetracer-python-recorder/src/runtime/io_capture/mod.rs: codetracer-python-recorder/src/runtime/io_capture/mute.rs: codetracer-python-recorder/src/runtime/io_capture/proxies.rs: codetracer-python-recorder/src/runtime/io_capture/sink.rs: codetracer-python-recorder/src/runtime/logging.rs: codetracer-python-recorder/src/runtime/mod.rs: codetracer-python-recorder/src/session.rs: design-docs/io-capture-line-proxy-implementation-plan.status.md: Signed-off-by: Tzanko Matev <[email protected]>
README.md: codetracer-python-recorder/codetracer_python_recorder/cli.py: codetracer-python-recorder/tests/python/unit/test_cli.py: examples/README.md: examples/io_capture.py: examples/stdin_capture.py: Signed-off-by: Tzanko Matev <[email protected]>
codetracer-python-recorder/Cargo.lock: codetracer-python-recorder/Cargo.toml: codetracer-python-recorder/src/runtime/mod.rs: design-docs/adr/0008-line-aware-io-capture.md: design-docs/io-capture-line-proxy-implementation-plan.md: Signed-off-by: Tzanko Matev <[email protected]>
README.md: codetracer-python-recorder/Cargo.lock: codetracer-python-recorder/Cargo.toml: codetracer-python-recorder/src/policy.rs: codetracer-python-recorder/src/runtime/io_capture/fd_mirror.rs: codetracer-python-recorder/src/runtime/io_capture/install.rs: codetracer-python-recorder/src/runtime/io_capture/mod.rs: codetracer-python-recorder/src/runtime/io_capture/proxies.rs: codetracer-python-recorder/src/runtime/io_capture/sink.rs: codetracer-python-recorder/src/runtime/mod.rs: design-docs/adr/0008-line-aware-io-capture.md: design-docs/io-capture-line-proxy-implementation-plan.md: design-docs/io-capture-line-proxy-implementation-plan.status.md: Signed-off-by: Tzanko Matev <[email protected]>
codetracer-python-recorder/src/runtime/io_capture/fd_mirror/controller.rs: codetracer-python-recorder/src/runtime/io_capture/fd_mirror/ledger.rs: codetracer-python-recorder/src/runtime/io_capture/fd_mirror/mod.rs: codetracer-python-recorder/src/runtime/io_capture/fd_mirror/stub.rs: codetracer-python-recorder/src/runtime/io_capture/fd_mirror/unix.rs: codetracer-python-recorder/src/runtime/io_capture/fd_mirror.rs: codetracer-python-recorder/src/runtime/io_capture/mod.rs: codetracer-python-recorder/src/runtime/io_capture/pipeline.rs: codetracer-python-recorder/src/runtime/io_capture/proxies/common.rs: codetracer-python-recorder/src/runtime/io_capture/proxies/input.rs: codetracer-python-recorder/src/runtime/io_capture/proxies/mod.rs: codetracer-python-recorder/src/runtime/io_capture/proxies/output.rs: codetracer-python-recorder/src/runtime/io_capture/proxies.rs: codetracer-python-recorder/src/runtime/io_capture/sink/batcher.rs: codetracer-python-recorder/src/runtime/io_capture/sink/enricher.rs: codetracer-python-recorder/src/runtime/io_capture/sink/mod.rs: codetracer-python-recorder/src/runtime/io_capture/sink/types.rs: codetracer-python-recorder/src/runtime/io_capture/sink.rs: codetracer-python-recorder/src/runtime/mod.rs: Signed-off-by: Tzanko Matev <[email protected]>
README.md: codetracer-python-recorder/src/runtime/io_capture/fd_mirror/unix.rs: design-docs/io-capture-line-proxy-implementation-plan.status.md: Signed-off-by: Tzanko Matev <[email protected]>
codetracer-python-recorder/CHANGELOG.md: design-docs/io-capture-line-proxy-implementation-plan.status.md: Signed-off-by: Tzanko Matev <[email protected]>
a823b35
to
a4aa676
Compare
This is a complete rewrite of the io-capture feature. |
Coverage SummaryRust (lines)
Python (statements)
Generated automatically via |
looks good: if it manages to match steps correctly on flushing / after step as i saw some code, it should be probably ok: not sure how much the overhead is, but this will be probably easily tested when tried with real useful programs |
@codex review this |
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. |
Now the agents even try to kiss us. |
No description provided.